package com.nifostasky.comic.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 日期工具类
 */
public class DateUtil {
	
	/**
	 * yyyy-MM-dd HH:mm:ss
	 */
	public static final String DATE_FULL_STR = "yyyy-MM-dd HH:mm:ss";
	
	/**
	 * yyyy-MM-dd
	 */
	public static final String DATE_YMD_STR = "yyyy-MM-dd";
	
	/**
	 * HH:mm:ss
	 */
	public static final String DATE_HMS_STR = "HH:mm:ss";
	
	/**
	 * yyyyMMddHHmmss
	 */
	public static final String DATE_SHORT_STR = "yyyyMMddHHmmss";
	
	/**
	 * 获取系统当前时间
	 * @return yyyy-MM-dd HH:mm:ss
	 */
	public static String getNowTime(){
		LocalDateTime now = LocalDateTime.now();
		String format = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
		return format;
	}
}
